<?php

namespace App\Kuafu\Shop\Enum;

class ShopCacheEnum
{
    private const SHOP_PRODUCT_STATUS = 'shop-product-status';
    private const SHOP_INFO           = 'shop-info';
    private const SHOP_INFO_ARCHIVES  = 'shop-info-archives';

    private const SHOP_USER_USUALLY   = 'shop_user_usually:uid:%d';
    private const SHOP_CUSTOM_PAYMENT = 'shop_custom_payment:shopId:%d';

    private const DIRECT_WHITE_SHOP_IDS = 'direct-white-shop-ids';

    /**
     * 店铺自定义的菜品信息列表
     * @param int $shopId
     * @return string
     */
    public static function getShopProductStatus(int $shopId): string
    {
        return sprintf(self::SHOP_PRODUCT_STATUS . ":%d", $shopId);
    }

    /**
     * 店铺自定义的菜品信息列表
     * @param int $shopId
     * @return string
     */
    public static function getCustomShopProductStatus(int $shopId): string
    {
        return sprintf(self::SHOP_PRODUCT_STATUS . "-custom:%d", $shopId);
    }

    /**
     * 单个店铺的信息
     * @param int $shopId
     * @return string
     */
    public static function getShopInfo(int $shopId): string
    {
        return sprintf(self::SHOP_INFO . ':%d', $shopId);
    }


    /**
     * 单个店铺的信息
     * @param int $shopId
     * @return string
     */
    public static function getShopArchivesInfo(int $shopId): string
    {
        return sprintf(self::SHOP_INFO_ARCHIVES . ':%d', $shopId);
    }

    /**
     * 用户常去门店
     *
     * @param int $uid
     * @return string
     */
    public static function getShopUserUsually(int $uid): string
    {
        return vsprintf(self::SHOP_USER_USUALLY, [$uid]);
    }


    /**
     * 获取自定义支付方式
     *
     * @param int $shopId
     * @return string
     */
    public static function getShopCustomPayment(int $shopId): string
    {
        return vsprintf(self::SHOP_CUSTOM_PAYMENT, [$shopId]);
    }

    /**
     * 直营店的白名单列表
     * @return string
     */
    public static function getDirectWhiteShopIds()
    {
        return sprintf(self::DIRECT_WHITE_SHOP_IDS);
    }

    /**
     * 抖音对应门店列表
     *
     * @param string $id
     * @return string
     */
    public static function getDouyinProductShopListBySkuId(string $id): string
    {
        return 'getDouyinProductShopListBySkuId:' . $id;
    }
}
